<?php include_once 'brand_header_index.php' ;?>
<!--主体内容-->
<div class="main brand">
	<div class="warp">
    	<div class="focus_left">
        	<div class="banner"><img id="bannerPicBig" src="images/brand/<?php echo $brandslide[0]['pic'];?>" style="width:690px;height:264px;" /></div>
            <div class="ann" style="overflow:hidden;">
            	<span>最新活动:</span>
                <ul id="last_activities">
				<?php foreach($huodongs as $huodong){?>
                <li style="margin-right:20px;width:auto;"><a href="index.php?mod=event&code=detail&id=<?php echo $huodong['id'];?>">· <?php echo $huodong['title'];?></a></li>
               	<?php }?>
                </ul>
            </div>
        </div>
        <div class="focus_right">
        	<img id="bannerPicS1" src="images/brand/<?php echo $brandslide[1]['pic'];?>" /><br />
        	<img id="bannerPicS2" src="images/brand/<?php echo $brandslide[2]['pic'];?>" style=" padding-top:10px;" />
        </div>
		<div class="float_both" ></div>
    </div>
	<div class="mt20">
    	<div class="recommend_title">
        	<span>重点推荐</span>
        	<div class="search">
            <select name="">
              <option>分类搜索</option>
              <option>分类搜索</option>
            </select><input type="text" onFocus="this.value=''" value="搜微博、找人" class="c_search_text" /><input type="submit" class="c_search_submit" value="" /></div>
        </div>
		<div class="float_both" ></div>
        <div class="recommend">
		
        	<div class="big"><a href="index.php?mod=brandindex&code=detail&id=<?php echo $tobaccolist[0]['id'];?>"><img src="images/brand/<?php echo $tobaccolist[0]['pic'];?>" style="width:300px;height:300px;" /></a></div>
        	<div class="small">
            <ul>
			<?php foreach(array_slice($tobaccolist,1) as $tobaccos){?>
            <li><a href="index.php?mod=brandindex&code=detail&id=<?php echo $tobaccos['id'];?>"><img src="images/brand/<?php echo $tobaccos['pic'];?>" /><?php echo $tobaccos['brandseri'];?></a></li>
           	<?php }?>
            </ul>
            </div>
		<div class="float_both" ></div>
        </div>
    </div>
    <div class="float_both" > </div>
	<div class="mt20">
    	<div class="recommend_title">
        	<span>新品速递</span>
        </div>
		<div class="float_both" ></div>
        <div class="recommend news">
            <ul>
			<?php foreach($newtobacco as $tobs){?>
            <li><a href="index.php?mod=brandindex&code=detail&id=<?php echo $tobs['id'];?>"><img src="images/brand/<?php echo $tobs['pic'];?>" /><?php echo $tobs['tobacco_name'];?></a></li>
           	<?php }?>
            </ul>
    		<div class="float_both" > </div>
        </div>
    </div>
    <div class="float_both" > </div>

	
	
	
		<div class="img-scroll mt20">
			<span class="prev"><img src="templates/brand/images/slide_left.gif" /></span>
			<span class="next"><img src="templates/brand/images/slide_right.gif" /></span>
			<div class="img-list">
			<ul>
			<?php foreach( $guanbos as $guanbo ){ 
			 $guanbo['pictx'] = !empty($guanbo['pictx'])?$guanbo['pictx']:'no.gif';
			echo "<li><a href=\"index.php?mode=guanbo&id=".$guanbo['id']."\"><img style=\"width:148px;height:115px;\" src=\"images/face/".$guanbo['pictx']."\" />".$guanbo['gsmc']."</a></li>\n";
			} ?>
			</ul>
			</div>
		</div>
    <div class="float_both" > </div>
</div>
<script type="text/javascript">
function scroll(){
	tmp = $("#last_activities").find("li").first();
	tmp.remove();
	$("#last_activities").find("li").first().hide().fadeIn('slow');
	$("#last_activities").append(tmp);
	//$("#last_activities").find("li").first().hide('300');
	
}

$(function(){
	setInterval('scroll()',3500);
	$("#bannerPicS1,#bannerPicS2").bind({
		click:function(){
		tmp = $("#bannerPicBig").attr("src");
		$("#bannerPicBig").attr( "src",$(this).attr("src") );
		$(this).attr("src",tmp);	
		},
		mouseover:function(){
		tmp = $("#bannerPicBig").attr("src");
		$("#bannerPicBig").attr( "src",$(this).attr("src") );
		$(this).attr("src",tmp);	
		}
	});
})

	function DY_scroll(wraper,prev,next,img,speed,or)
	{	
		var wraper = $(wraper);
		var prev = $(prev);
		var next = $(next);
		var img = $(img).find('ul');
		var w = img.find('li').outerWidth(true);
		var s = speed;
		next.click(function()
			{
				img.animate({'margin-left':-w},function()
				{
					img.find('li').eq(0).appendTo(img);
					img.css({'margin-left':0});
					});
				});
		prev.click(function()
			{
				img.find('li:last').prependTo(img);
				img.css({'margin-left':-w});
				img.animate({'margin-left':0});
				});
		if (or == true)
		{
			ad = setInterval(function() { next.click();},s*1000);
			wraper.hover(function(){clearInterval(ad);},function(){ad = setInterval(function() { next.click();},s*1000);});
		}
	}
	DY_scroll('.img-scroll','.prev','.next','.img-list',3,true);// true为自动播放，不加此参数或false就默认不自动
</script>
<!--底部-->
<?php include_once 'brand_footer.php' ;?>
